package com.huike.business.service.impl;


import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.mapper.TbBusinessTrackRecordMapper;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.security.Key;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 商机跟进记录Service业务层处理
 * 
 * @author wgl
 * @date 2021-04-28
 */
@Service
public class TbBusinessTrackRecordServiceImpl implements ITbBusinessTrackRecordService {

    @Autowired
    private TbBusinessTrackRecordMapper businessTrackRecordMapper;

    /**
     * 根据 businessId 查询商机跟进记录列表功能
     * @param businessId
     * @return
     */
    @Override
    public AjaxResult selectAllById(Long businessId) {
        // 1. 根据 id 获取 TbBusinessTrackRecord
        List<TbBusinessTrackRecord> businessTrackRecordList = businessTrackRecordMapper.selectAllByBusinessId(businessId);

        // 2. 返回结果数据
        return AjaxResult.success(businessTrackRecordList);
    }
}
